package xiangmu.schoolpaper.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xiangmu.schoolpaper.pojo.VO.*;
import xiangmu.schoolpaper.result.Result;
import xiangmu.schoolpaper.service.impl.LatestUploadServiceImpl;

import java.util.List;

@RestController
@RequestMapping
@Slf4j
@Tag(name="指导学生最新论文上传情况接口")
public class LatestUploadController {
    @Autowired
    private LatestUploadServiceImpl latestUploadServiceImpl;

    @GetMapping("/teacher/getAllStudentPaper")

    public Result getAllStudentPaper(Integer teacher){
        log.info("查看所有指导学生的最新论文上传情况");
        List<AllStudentPaperVO> list =latestUploadServiceImpl.getAllStudentPaper(teacher);
        return Result.success(list);
    }
    @GetMapping("/teacher/title")
    public Result getAllStudentPaperTitle(Integer teacher,String paperTitle){
        log.info("根据题目查看所有指导学生的最新论文上传情况");
        List<AllStudentPaperVO> list =latestUploadServiceImpl.getAllStudentPaperTitle(teacher,paperTitle);
        return Result.success(list);
    }
    @GetMapping("/teacher/studentInfo")
    public Result getStudentInfo(Integer teacher){
        log.info("返回的是学生的姓名和学号");
        List<GetStudentNameVO> getStudentNameVO= latestUploadServiceImpl.getStudentInfo( teacher);
        return Result.success(getStudentNameVO);
    }
    @GetMapping("/teacher/graduationYear")
    public Result getGraduationYear(Integer teacher){
        log.info("返回的是学生的毕业年份");
        List<Integer> graduationYear= latestUploadServiceImpl.getGraduationYear( teacher);
        return Result.success(graduationYear);
    }
    @GetMapping("/teacher/extractContent")
    public Result getextractContent(Integer teacher){
        log.info("查看抽取正文内容");
        List<ExtractConentVO> list=latestUploadServiceImpl.getextractContent(teacher);
        return Result.success(list);
    }
    @GetMapping("/teacher/allPaper/Score")
    public Result getAllPaperScore(Integer teacher){
        log.info("展示所有指导学生的论文得分信息");
        List<PaperScoreVO> list=latestUploadServiceImpl.getAllPaperScore(teacher);
        return Result.success(list);
    }
    @GetMapping("/teacher/getByStudentId/paper")
    public Result getByStudentId(Integer teacher,Integer studentId){
        log.info("根据学生id展示学生的论文得分");
        List<SomeStudentScoreVO> list =latestUploadServiceImpl.getByStudentId(teacher,studentId);
        return Result.success(list);

    }


}
